package sharping.appilog.ViewControl;

import sharping.appilog.R;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Window;
import android.widget.ImageView;

public class LikeDialog extends Dialog {

	public LikeDialog(Context context) {
		super(context);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ImageView img = new ImageView(getContext());
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(img);
		
		img.setImageResource(R.drawable.ic_addlike);
		
		
		getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
		getWindow().getAttributes().windowAnimations = R.style.LikeDialog;
		this.setCancelable(false);
		
		new AsyncTask<Void, Void, Void>() {

			@Override
			protected Void doInBackground(Void... params) {
				
				try {
					Thread.sleep(1000);
				} catch (Exception e) {
					// TODO: handle exception
				}
				
				return null;
			}
			
			@Override
			protected void onPostExecute(Void result) {
				super.onPostExecute(result);
				
				LikeDialog.this.dismiss();
			}
		}.execute();
	}

}
